<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改教练</title>
    <th:block th:include="fragments/header :: header"/>
</head>
<body class="easyui-layout">
<div data-options="region:'center',border:false">
    <form id="coachForm" action="" method="post" style="padding-top: 10px;padding-left: 20px;"  th:object="${coachModel.coach}">
        <input type="hidden" name="id" th:value="*{id}">
        <table width="90%">
            <tr>
                <td>姓名:</td>
                <td>
                    <input class="easyui-textbox" name="name" th:value="*{name}" style="width: 90%" data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td>生日:</td>
                <td>
                    <!-- 加验证不得晚于当前时间 -->
                    <input class="easyui-datebox" id="birthday" name="birthday" style="width: 90%" data-options="required:true">
                </td>
            </tr>
        </table>
    </form>
</div>
<!--<div data-options="region:'south',border:false">-->
<!--    <div style="text-align: center">-->
<!--        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">提交</a>-->
<!--        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">取消</a>-->
<!--    </div>-->
<!--</div>-->
<script th:inline="javascript">
    /*<![CDATA[*/
    var birthday = /*[[${coachModel.coach.birthday}]]*/ "";
    $("#birthday").val(birthday);
    /*]]>*/
</script>
<script>
    function submitForm() {
        $("#coachForm").form('submit',{
            url:'/markt/coach/save',
            onSubmit:function () {
                return $(this).form('enableValidation').form('validate');
            }
            // ,
            // success:function () {
            //     var index = parent.layer.getFrameIndex(window.name);
            //     parent.layer.close(index);
            // }
        });
    }

    // function clearForm() {
    //     var index = parent.layer.getFrameIndex(window.name);
    //     parent.layer.close(index);
    // }
</script>
</body>
</html>
